<template>

<button  @click="showInfor">点击按钮更换图片</button>
<img src="url" >
<input type="text" @keydown="showInfor1">
</template>


<script  setup>
//funcetion showInfor(){

//}
import { ref } from 'vue';
//显示图片
let url = new URL("../assets/img1.webp,import.meta.url").href;

const showInfor =() =>{

//console.log("欢迎来到Vue3指令")
url.value = new URL("../assets/img1.webp,import.meta.url").href;
};
const showInfor1 = ()=>{
alert("按下按钮");
};

</script>

<style>



</style>